<?php
/**
 * Created by PHPStorm
 * User: xiest
 * Date: 2021/9/16
 * Email: <939369942@qq.com>
 */
namespace basic\listens;
use basic\interfaces\ListenerInterface;
use Swoole\Exception;
use Swoole\Process;
use Swoole\Server;
use think\facade\Log;
use think\swoole\Manager;

class TimerListen implements ListenerInterface
{

    public function handle($event): void
    {
        /**@var $make Manager**/
        $make = app()->make(Manager::class);
        $make->addWorker(function (){
            app()->event->trigger('create_timer');
            Log::info('定时器运行---------');
        },'timer');
    }
}